﻿using AccustomeAttributedll;
using AixCommInfo;
using ISaveReaddll;
using System;


namespace FinalTestMachine.Motion.Aixs.Site4
{
    /// <summary>
    /// 工位4平面光源升降轴
    /// </summary>
    public class Aix_Site4_PlaneSourceLift  : AixCreateBase
    {
        private Aix_Site4_PlaneSourceLift () : base(AM.Core.Axis.AxisInfoManger.GetAxisInfo(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name))
        {

        }
        public static readonly Aix_Site4_PlaneSourceLift  Cur = new Aix_Site4_PlaneSourceLift ();
        public static Aix_Site4_PlaneSourceLift  CreateInstrance()
        {
            return Cur;
        }

        #region 覆写方法区

        #endregion

        #region 功能实例

        [SaveRemark]
        [TextBoxRemark("等待位")]
        [ButtonRemark("等待位")]
        /// <summary>
        /// 等待位
        /// </summary>
        public SingleAixPosAndSpeedMsgAndIMov WaitPos = new SingleAixPosAndSpeedMsgAndIMov(() => Cur);


        [SaveRemark]
        [TextBoxRemark("工作位")]
        [ButtonRemark("工作位")]
        /// <summary>
        /// 工作位
        /// </summary>
        public SingleAixPosAndSpeedMsgAndIMov WorkPos = new SingleAixPosAndSpeedMsgAndIMov(() => Cur);


        #endregion

        #region 方法操作
        /// <summary>
        /// 检测是否在安全位
        /// </summary>
        /// <returns></returns>
        public override bool CheckSafePos()
        {
            return Math.Abs(this.GetEncPos() - WaitPos.PosMsg.GetValue) <= 2;
        }
        #endregion

    }
}
